package group.igfd.manager.biz.service.impl;

import org.springframework.stereotype.Service;

import java.util.Map;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import group.igfd.manager.biz.dao.TagHotDao;
import group.igfd.manager.biz.entity.TagHotEntity;
import group.igfd.manager.biz.service.TagHotService;
import org.springframework.util.ObjectUtils;


@Service("tagHotService")
public class TagHotServiceImpl extends ServiceImpl<TagHotDao, TagHotEntity> implements TagHotService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        EntityWrapper<TagHotEntity> ew = new EntityWrapper<>();
        if (!ObjectUtils.isEmpty(params.get("key"))) {
            ew.like("name", params.get("key") + "");
        }
        Page<TagHotEntity> page = this.selectPage(
                new Query<TagHotEntity>(params).getPage(),
                ew
        );

        return new PageUtils(page);
    }

}
